package com.tanxh.sss;

import com.tanxh.sss.intercepter.SecureIntercepter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * create by tanxh on 2020-05-17
 **/
@Configuration
public class WebConfigurer implements WebMvcConfigurer {

    @Autowired
    private SecureIntercepter SecureIntercepter;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        //添加权限校验拦截器
        registry.addInterceptor(SecureIntercepter)
                .addPathPatterns("/**")
                .excludePathPatterns("/login", "/error", "/static/**", "/favicon.ico");

    }

}
